package com.ly.cyclictest.test01;

public class BarrierRun implements Runnable {

    boolean flag = false;

    int N;

    public BarrierRun(int N){
        this.N = N;
        System.out.println("司令:集合");
    }

    @Override
    public void run() {
        if(flag){
            System.out.println("司令:"+N+"个士兵,任务完成,返回");
        }else {
            System.out.println("司令:"+N+"个士兵,开始执行任务");
            flag = true;
        }
    }
}
